import { Link } from "react-router-dom";
import { Images } from "../../lib/types.js ";
import "./Gallery.css";

interface GalleryProps {
  data: Images[];
}

const Gallery = ({ data }: GalleryProps) => {
  return (
    <div className="container">
      {data.map((image: Images) => {
        return (
          <Link key={image.id} to={`/image/${image.id}`}>
            <img className="images" src={image.src} alt={image.alt} />
          </Link>
        );
      })}
    </div>
  );
};

export default Gallery;
